import wx

class SizeEvent(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title)
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Centre()
    def OnSize(self, event):
        self.SetTitle(str(event.GetSize()))
class MyApp(wx.App):
    def OnInit(self):
        se = SizeEvent(None, -1, 'sizeevent.py')
        se.Show()
        return True
app = MyApp(0)
app.MainLoop()
